<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui" template="/template/template.xhtml">
	
	
	<ui:define name="conteudo1">
		<h:form>
		<h1>Cadastrar Quarto</h1>
		<br/>
		<h:outputText value="Dados do Quarto:" />
		<hr/>
	
		<h:panelGrid columns="2">
			<h:outputText value="Tipo do Quarto:" />
			<p:selectOneMenu value="#{quartoAction.quarto.tipoQuarto}">
				<f:selectItem itemLabel="Selecione...."/>
				<f:selectItems value="#{quartoAction.tiposQuartos}" var="tipo"
				 itemLabel="#{tipo}" itemValue="{tipo}"/>
			</p:selectOneMenu>
			
			<h:outputText value="Numero do Quarto: " />
			<p:inputText value="#{quartoAction.quarto.numero}"/>
			</h:panelGrid>
			<br/>
			
			<h:outputText value="Consumiveis:" />
			<hr/>
			<p:selectManyCheckbox value="#{quartoAction.consumiveisList}" layout="pageDirection" converter="#{quartoAction.converter}">
				<f:selectItems value="#{quartoAction.consumiveis}"/>
			</p:selectManyCheckbox>
			
			<p:commandButton value="Confirmar" update="display" oncomplete="dlg.show()" />  
  
		    <p:dialog header="Confirmar Cadastro" modal="true" showEffect="fade" hideEffect="fade" widgetVar="dlg" width="250" height="350">  
		        <p:outputPanel id="display">  
		        	
		        	<h:outputText value="Dados do Quarto" />
		        	<hr/>
		        	
		        	<h:panelGrid columns="2">
		        		<h:outputText value="Tipo do Quarto:" />
		        		<h:outputText value="#{quartoAction.quarto.tipoQuarto.nome}"/>
		        	
		        		<h:outputText value="Numero do Quarto:" />
		        		<h:outputText value="#{quartoAction.quarto.numero}"/>
		        	</h:panelGrid>
		        	
		        	<br/>
		        	<h:outputText value="Consumiveis:" />
		        	<hr/>
		        
		            <p:dataList value="#{quartoAction.consumiveisList}" var="lista">  
		                #{lista}  
		            </p:dataList>  
		            
		            <p:commandButton value="Cadastrar" action="#{quartoAction.cadastrarQuarto()}" />  
		        </p:outputPanel>  
		    </p:dialog>  	
    		</h:form>
    	 </ui:define>
 			
 			

</ui:composition>